################################################################################### 
## 
## Hack Title:    Add option (yes/no) to profile 
## Hack Version:  1.0
## optional Part: Option is editable/visible only for certain users 1.0
## Author         Acid
## Support:	  http://www.phpbbhacks.com/forums
##
## Description:   If you want to set the option editable/visible only for
##		  certain users..
##		  If youve added more than one field duplicate the following
##		  steps and change "option" (be aware of the spelling).
##
## Required:      addoption_english.txt
##
## Files to edit: 2 (4)
##		  includes/usercp_register.php (usercp_viewprofile.php)
##                templates/xxx/profile_add_body.tpl (profile_view_body.tpl)
##
################################################################################### 
## 
## Installation/Author Notes: 
## First always backup the files that you're going to edit. 
## 
################################################################################### 
##
## Versions:
##
## 1.0   - optional part added
##
################################################################################### 
# 
#-----[ OPEN ]------------------------------------------
#  
# includes/usercp_register.php (usercp_viewprofile.php)
# 
#-----[ FIND ]---------------------------------------------------
# 
$template->pparse('body');

# 
#-----[ ADD BEFORE ]---------------------------------------------------
# 
# thats just an example, define whatever you want (example: only for admins)
# $userdata['user_level'] == MOD (only for mods)
# $userdata['user_posts'] >= 10 (only for users with more than 10 posts)

if ( $userdata['user_level'] == ADMIN )
{
        $template->assign_block_vars('switch_certain_users', array() );
}



# 
#-----[ OPEN ]------------------------------------------
#  
# templates/xxx/profile_add_body.tpl
# 
#-----[ FIND ]---------------------------------------------------
# 
	<tr> 
	  <td class="row1"><span class="gen">{L_OPTION}:</span></td>
	  <td class="row2"> 
		<input type="radio" name="option" value="1" {OPTION_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="option" value="0" {OPTION_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>

# 
#-----[ REPLACE WITH ]---------------------------------------------------
# 
<!-- BEGIN switch_certain_users -->
	<tr> 
	  <td class="row1"><span class="gen">{L_OPTION}:</span></td>
	  <td class="row2"> 
		<input type="radio" name="option" value="1" {OPTION_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="option" value="0" {OPTION_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>
<!-- END switch_certain_users -->



# 
#-----[ OPEN ]------------------------------------------
#  
# templates/xxx/profile_view_body.tpl
# 
#-----[ FIND ]---------------------------------------------------
# 
		<tr> 
		  <td valign="top" align="right"><span class="gen">{L_OPTION}:</span></td>
		  <td> <b><span class="gen">{OPTION}</span></b></td>
		</tr>

# 
#-----[ REPLACE WITH ]---------------------------------------------------
# 
<!-- BEGIN switch_certain_users -->
		<tr> 
		  <td valign="top" align="right"><span class="gen">{L_OPTION}:</span></td>
		  <td> <b><span class="gen">{OPTION}</span></b></td>
		</tr>
<!-- END switch_certain_users -->


################################################################################### 
################################################################################### 
###################################################################################